{% extends "base.html" %}

{% block title %}Log in{% endblock %}

{% block head %}
<script type="text/javascript">
  $(function() {
    $("#id_username").focus();
  });
</script>
{% endblock %}

{% block primary-content %}
<span class="breadcrumbs"><a href="{% url index %}" title="Home">Home</a> &raquo; Login</span>
<h2>Log in to {{ site.name }}</h2>
<p class="page-intro">Log in to view your representatives, comment on blog posts and reports, and get a personalized news feed.</p>
<div class="form-wrapper clearfix" id="login-wrapper">
	<h3>Log in to {{ site.name }}</h3>
	<p>Don't have an account? <a href="{% url registration_register %}">Sign up</a> for free.</p>
	{% if form.errors %}
	<p class="error">Your username and password didn't match. If you can't remember your password, go ahead and <a href="{% url auth_password_reset %}">reset it</a>.</p>
	{% endif %}
	<form id="login" class="simple-form" method="post">
		{% csrf_token %}
		<input type="hidden" name="next" value="{{ next }}" />
		<div class="form-item{% if form.username.errors %} error{% endif %}">
			<label for="id_username">Username</label>
			{{ form.username }}
		</div>      
		<div class="form-item{% if form.password.errors %} error{% endif %}">
			<label for="id_password">Password</label>
			{{ form.password }}
		</div>
		<div class="form-input clear-left">
			<input class="button" type="submit" value="Log in"/>
		</div>
	</form>
	<p id="password-forget">Forget your password? You can <a title="Reset your password" href="{% url auth_password_reset %}">Reset it</a>.</p>
</div><!--end .form-wrapper-->
{% endblock %}

{% block secondary-content %}
  {% include "snippets/reports_and_news.html" %}
{% endblock %}

